﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace bdnt_pets_system_Entity
{
    [DataContract]
    public class Tbl_Menu : INotifyPropertyChanged
    {
        Int32 id;
        [DataMember]
        public Int32 Id
        {
            get { return id; }
            set { id = value; }
        }

        string menuName;
        [DataMember]
        [Required(ErrorMessage = "*")]
        public string MenuName
        {
            get { return menuName; }
            set
            {
                if (menuName != value)
                {
                    Validator.ValidateProperty(value,
                        new ValidationContext(this, null, null) { MemberName = "MenuName" });
                    menuName = value;
                    this.OnPropertyChanged("MenuName");

                }
            }
        }

        string en_menuName;
        [DataMember]
        [Required(ErrorMessage = "*")]
        public string en_MenuName
        {
            get { return en_menuName; }
            set
            {
                if (en_menuName != value)
                {
                    Validator.ValidateProperty(value,
                        new ValidationContext(this, null, null) { MemberName = "en_MenuName" });
                    en_menuName = value;
                    this.OnPropertyChanged("en_MenuName");

                }
            }
        }         

        string menuModule;
        [DataMember]
        public string MenuModule
        {
            get { return menuModule; }
            set { menuModule = value; }
        }

        Int32 menuSequence;
        [DataMember]
        [Range(0, 999999, ErrorMessage = "0~999999")]
        public Int32 MenuSequence
        {
            get { return menuSequence; }
            set
            {
                if (menuSequence != value)
                {
                    Validator.ValidateProperty(value,
                        new ValidationContext(this, null, null) { MemberName = "MenuSequence" });
                    menuSequence = value;
                    this.OnPropertyChanged("MenuSequence");
                }
            }
        }

        Int32 pMenuId;
        [DataMember]
        public Int32 PMenuId
        {
            get { return pMenuId; }
            set { pMenuId = value; }
        }

        string pMenuName;
        [DataMember]
        public string PMenuName
        {
            get { return pMenuName; }
            set { pMenuName = value; }
        }


        byte[] icon;
        [DataMember]
        public byte[] Icon
        {
            get { return icon; }
            set { icon = value; }
        }

        Int32 menuType;
        [DataMember]        
        public Int32 MenuType
        {
            get { return menuType; }
            set { menuType = value; }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string PropName)
        {
            if (PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(PropName));
            }
        }

    }
}
